package com.fla.shapeevader.model;

import android.graphics.RectF;

public abstract class Trajectory {
    // radian
    private float direction;

    // px
    private float speed;

    public Trajectory(float direction, float speed) {
        super();
        this.direction = direction;
        this.speed = speed;
    }
    
    public abstract float getDx();
    
    public abstract float getDy();
    
    public abstract void recalculateParams(RectF bounds, float fullWidth, float fullHeight);

    protected Trajectory updateRightReflection() {
        direction = (float) Math.PI - direction;
        return this;
    }

    protected Trajectory updateLeftReflection() {
        direction = (float) (3 * Math.PI) - direction;
        return this;
    }

    protected Trajectory updateBottomReflection() {
        direction = (float) (2 * Math.PI) - direction;
        return this;
    }

    protected Trajectory updateTopReflection() {
        direction = (float) (2 * Math.PI) - direction;
        return this;
    }

    protected float getDirection() {
        return direction;
    }

    protected float getSpeed() {
        return speed;
    }
}
